# input is in lgistic.csv
# output is in logistic.out

setwd( "D:/AAAI ConcSDP Code/concurrent-value-iteration/" );

data <- read.csv("logistic.csv", header=TRUE);

attach(data)

named <- names(data )
len <- length( named )
named <- subset( named, named !="flip" )

form <- as.formula ( paste( "flip ~ ", paste( named, collapse="+") ) )

mod <- glm( form, family = quasibinomial )

coef <- as.vector( mod$coefficients ) 

write( coef, file="logistic.out" )